﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

using GameEngine.Graphics;


namespace GameEngine
{
    public class Bullet
    {
        private Vector2 _Position;
        private Int32 _Lifetime;
        private Vector2 _Movement;
        private bool _Die;

        public Bullet(Vector2 Position, Int32 Lifetime, Vector2 Movement)
        {
            _Position = Position;
            _Lifetime = Lifetime;
            _Movement = Movement;
        }

        public void Draw(SpriteBatch spriteBatch, Texture2D Texture)
        {
            spriteBatch.Draw(Texture, _Position, Color.White);
        }

        public Vector2 Update()
        {
            _Position += _Movement;
            _Lifetime--;

            if (_Lifetime <= 0)
            {
                _Die = true;
            }

            return _Position;
        }

        public bool Die
        {
            set { _Die = value; }
            get { return _Die; }
        }

        public Vector2 Position
        {
            get { return _Position; }

        }

    }
}
